home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / System7 tools / Frontier / Frontier SDK 2.1 / Toolkits / IAC Tools / iacpoint.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-09  |  1.6 KB  |  77 lines  |  [TEXT/KAHL]

  1.  
  2. /*© Copyright 1988-1993 UserLand Software, Inc.  All Rights Reserved.*/
  3.  
  4. #include "iacinternal.h"
  5.  
  6.  
  7. #define typePoint 'QDpt'
  8.  
  9.  
  10. Boolean IACpushpointparam (Point val, OSType keyword) {
  11.     
  12.     return (IACpushpointitem (IACglobals.event, val, keyword));
  13.     } /*IACpushpointparam*/
  14.  
  15.  
  16. Boolean IACreturnpoint (Point x) {
  17.     
  18.     return (IACpushpointitem (IACglobals.reply, x, keyDirectObject));
  19.     } /*IACreturnpoint*/
  20.  
  21.  
  22. Boolean IACgetpointparam (OSType keyword, Point *val) {
  23.     
  24.     if (!IACgetpointitem (IACglobals.event, keyword, val)) {
  25.     
  26.         IACparamerror (IACglobals.errorcode, "\ppoint", keyword);
  27.         
  28.         return (false);
  29.         }
  30.     
  31.     IACglobals.nextparamoptional = false; /*must be reset for each param*/
  32.     
  33.     return (true);
  34.     } /*IACgetpointparam*/
  35.     
  36.     
  37. Boolean IACgetpointitem (AEDescList *list, long n, Point *val) {
  38.     
  39.     register OSErr ec;
  40.     DescType key;
  41.     DescType typeCode;
  42.     Size actualSize;
  43.     
  44.     if ((*list).descriptorType != typeAEList) {
  45.     
  46.         ec = AEGetKeyPtr (list, n, typePoint, &typeCode, (Ptr)val,
  47.                           sizeof (*val), &actualSize);
  48.  
  49.         if (ec != errAEDescNotFound)
  50.             goto done;
  51.         }
  52.  
  53.     ec = AEGetNthPtr (list, n, typePoint, &key, &typeCode, (Ptr) val, sizeof (*val), &actualSize);
  54.     
  55.     done:
  56.     
  57.     IACglobals.errorcode = ec;
  58.     
  59.     return (ec == noErr);
  60.     } /*IACgetpointitem*/
  61.  
  62.  
  63. Boolean IACpushpointitem (AEDescList *list, Point val, long n) {
  64.     
  65.     register OSErr ec;
  66.     
  67.     if ((*list).descriptorType != typeAEList)
  68.         ec = AEPutKeyPtr (list, n, typePoint, (Ptr)&val, sizeof (val));
  69.     else
  70.         ec = AEPutPtr (list, n, typePoint, (Ptr)&val, sizeof (val));
  71.     
  72.     IACglobals.errorcode = ec;
  73.     
  74.     return (ec == noErr);
  75.     } /*IACpushpointitem*/
  76.  
  77.